package com.atde._04_structural_design_patterns.composite;


/**
 * @BelongsProject: hsp_java_design_mode
 * @BelongsPackage: com.atde._04_structural_design_patterns.composite
 * @Author: Del
 * @CreateTime: 2025-06-23  00:38
 * @Description: 组合模式  --- 测试类
 * @Version: 1.0
 */
public class Client {
    public static void main(String[] args) {
        // 从 大 到 小 创建 组织架构 即 创建学校
        OrganizationComponent university = new University("清华大学", "中国顶级大学");

        // 创建 学院
        OrganizationComponent college1 = new College("计算机学院", "计算机学院");
        OrganizationComponent college2 = new College("信息工程学院", "信息工程学院");


        // 创建各个学院下面的系（专业）
        Department department1 = new Department("软件工程", "软件工程");
        Department department2 = new Department("网络工程", "网络工程");
        Department department3 = new Department("计算机科学与技术", "计算机科学与技术");


        Department department4 = new Department("信息与计算科学", "信息与计算科学");
        Department department5 = new Department("通信工程", "通信工程");
        Department department6 = new Department("电子工程", "电子工程");
        Department department7 = new Department("信息工程", "信息工程");

        university.add(college1);
        university.add(college2);

        college1.add(department1);
        college1.add(department2);
        college1.add(department3);
        college2.add(department4);
        college2.add(department5);
        college2.add(department6);
        college2.add(department7);

        university.print();

    }
}
